// 定义格式化时间的方法
export const timeFormat = (current) => {
  // 年
  var year = current.getFullYear();
  // 月
  var month = current.getMonth() + 1;
  // 日
  var date = current.getDate();
  date = date < 10 ? "0" + date : date;
  // 星期几
  var
    dayList = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
    day = current.getDay();
  day = dayList[day];
  // 时
  var hour = current.getHours();
  hour = hour < 10 ? "0" + hour : hour;
  // 分
  var minute = current.getMinutes();
  minute = minute < 10 ? "0" + minute : minute;
  // 秒
  var second = current.getSeconds();
  second = second < 10 ? "0" + second : second;
  return (year + "年" + month + "月" + date + "日"
  + " " + hour + ":" + minute + ":" + second);
};

